package com.szzg10.thinking.chapter18;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;

public class TransferTo {

	public static void main(String[] args) throws IOException {
		FileInputStream fileInputStream = new FileInputStream(BufferedInputFile.FILE_NAME);
		FileChannel in = fileInputStream.getChannel();
		
		FileOutputStream fileOutputStream = new FileOutputStream(BasicFileOutput.FILE_NAME_OUT);
		FileChannel out = fileOutputStream.getChannel();
		
		out.transferFrom(in, 0, in.size());
		
		fileInputStream.close();
		fileOutputStream.close();
	}
}
